#ifndef TIMER_INIT_H_
#define TIMER_INIT_H_
#include "stm32f4xx.h"                  // Device header
#include "stdio.h"
#include "math.h"
#include "stdint.h"


//输入捕获引脚
#define  ADVANCE_IC_PIN      			GPIO_Pin_6
#define  ADVANCE_IC_PORT		 		GPIOC
#define	 ADVANCE_IC_GPIO_CLK			RCC_AHB1Periph_GPIOC
#define  ADVANCE_IC_PINSOURCE    		GPIO_PinSource6
#define  ADVANCE_IC_AF					GPIO_AF_TIM8
#define  ADVANCE_IC_CHANNEL				TIM_Channel_1

//高级控制定时器

#define  ADVANCE_TIM             			TIM8
#define  ADVANCE_TIM_CLK					RCC_APB2Periph_TIM8

//捕获/比较 中断

#define  ADVANCE_TIM_IRQn         TIM8_CC_IRQn
#define  ADVANCE_TIM_IRQHandler   TIM8_CC_IRQHandler

//输入捕获能捕获到的最小频率为 168M/{(ARR+1)*(PCS+1)}
//这里配置为1KHz

#define  ADVANCE_TIM_PERIOD				(65536-1)
#define  ADVANCE_TIM_PSC					(168-1)

volatile	extern double ConUploadFloat;                               //电导率分频后频率
volatile extern	float FreUploadFloat;       //上传的浮点数频率	

extern void TIMER_Init_Config(void);
extern void TIMx_NVIC_Configuration(void);
extern void Conductivity(void);

#endif

